package java68_5;

public class Teacher {
    String name;
    public float getAvg(Student s){
        System.out.println(name+"开始计算平均分");
        if(s.java<80)
            s.java+=20;//涨分
        s.show();
        float avg=(s.java+s.csharp+s.database)/3;
        return avg;
    }
    public float getAvg2(float java,float c,float db){
        if(java<80){
            java+=20;
        }
        System.out.println("这个学生三门课成绩分别是:java"+java+",database:"+db+",c#:"+c);
        float avg=(java+c+db)/3;
        return avg;
    }
    public float calcJavaAvg(Student[]sr){
        float sum=0;
        for(Student s:sr){
            sum+=s.java;
        }
        return sum/sr.length;
    }
}
